savaUser = function () {
    let nickName = document.getElementById('nickName').value;
    let sexInputs = document.getElementsByName("sex");
    let sex;
    for (let i = 0; i < sexInputs.length; i++) {
        let sexInput = sexInputs[i];
        if (sexInput.checked) {
            sex = sexInput.value
            break
        }
    }
    let signature = document.getElementById('signature').value;

    if (nickName === '' || nickName === null) {
        Qmsg.warning('昵称不能为空')
    }
    axios({
        url: "/api/save/user",
        method: 'post',
        data: {
            nickName: nickName,
            signature: signature,
            sex: sex
        },
        headers: {'Authorization': getToken()}
    })
        .then(function (response) {
            if (response.data.code === 200) {
                Qmsg.success("保存成功")

                //清楚token
                // window.location.reload()
            } else {
                Qmsg.error(response.data.msg)
            }
        }).catch(function (error) {
        console.log(error);
        Qmsg.error("未知错误")
    });
}
